<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::group(['namespace' => 'Api', 'prefix' => 'auth'], function () {
    Route::post('login', 'AuthController@login');
//    Route::post('logout', 'AuthController@logout');
});
Route::group(['namespace' => 'Api' , 'middleware' => ['auth:api']], function () {
    Route::post('logout', 'AuthController@logout');
    //获取当前登录人的个人信息
    Route::get('admin/profile', 'AdminController@getProfile');

    Route::post('import', 'ExcelController@importStudent');//导入
    Route::get('export', 'ExcelController@exportStudent');//导出
    Route::get('situation-info', 'StudentController@enrollmentSituation');//学校报名情况
    Route::get('print-info/{id}', 'PrintController@allStudent');//打印
    Route::get('print-log/{id}', 'PrintController@printInfo');//记录打印的操作
    Route::get('all-enroll/{id}', 'AllEnrollController@allEnroll');//一键录取
    Route::post('update-upper-limit/{id}', 'EnrollmentSituationController@update');//修改人数上线
    Route::resource('sign-up', 'StudentController', [
        'except' => ['create', 'edit']
    ]);
    Route::post('sign-up/post', 'AddStudentController@store');//录入
    Route::resource('user', 'AdminController', [
        'except' => ['create', 'edit']
    ]);//用户
    Route::resource('all-list', 'StudentController', [
        'except' => ['create', 'edit']
    ]);
    Route::get('logs', 'LogController@index');//Log
    Route::get('police/{id}', 'StudentController@getPoliceStation');//根据学校找警局
    Route::resource('student-enroll', 'StudentEnrollController');//录取结果页
});
